﻿using System;
using System.Threading;
using smp.RabbitMq;

namespace TestClientsCommon
{
    public class Message1Subscriber1 : ISubscriberHandler<Message1>
    {
        #region Implementation of ISubscriberHandler<Message1>

        public void Handle(Message1 message)
        {
            Console.WriteLine();
            Console.WriteLine("Subscriber 1 recieved message : ");
            Console.WriteLine("      Message number " + message.Number + ", with text " + message.Text);
            Console.WriteLine();
        }

        #endregion
    }

    public class Message1Subscriber1Slow : ISubscriberHandler<Message1>
    {
        #region Implementation of ISubscriberHandler<Message1>

        public void Handle(Message1 message)
        {
            Console.WriteLine();
            Console.WriteLine("Subscriber 1 recieved message on slow handler : ");
            Console.WriteLine("      Message number " + message.Number + ", with text " + message.Text);
            Console.WriteLine("Sleeping for 2 seconds.");
            Console.WriteLine();
            Thread.Sleep(2000);
        }

        #endregion
    }
}
